/**
 * @ author: 汪孟苹
 */
define(["jquery","template","bbcare"],function($,template,$bb){
	var servers = {};
	var URL = $bb.baseUrl("followapp");

	/* 建档任务查询 */
	servers.ajaxArchiveTask = function(params,callback){
		$bb.ajax({
			url: URL + "ctrl/cpmanage/qryArchiveTask",
			data:JSON.stringify({
				data : {
					"queueId":params.queueId,
					"schemeId":params.schemeId
				}
			}),
			success: function(data){
				if(data.success){
					callback(data.data,params);
				}else{
					$bb.toastShow(data.msg ? data.msg : "请求建档任务出错！");
				}	
			}
		});
	}
	/* 查询问卷 */
	servers.ajaxTaskContTempl = function(params,callback){
		$bb.ajax({
			url: URL + "ctrl/cpmanage/qryTaskContTempl",
			data:JSON.stringify({
				data : {
					"taskId":params.taskId,
					"schemeVersionId":params.schemeVersionId
				}
			}),
			success: function(data){
				if(data.success){
					callback(data.data,params);
				}else{
					$bb.toastShow(data.msg ? data.msg : "查询问卷出错！");
				}	
			}
		});
	}
	/* 新增患者 */
	servers.ajaxArchive = function(params,callback){
		$bb.ajax({
			url: URL + "ctrl/ptmanage/newArchive",
			data:JSON.stringify({
				data : params
			}),
			success: function(data){
				if(data.success){
					callback(data.data);
				}else{
					$bb.toastShow(data.msg ? data.msg : "新增患者出错！");
				}	
			}
		});
	}

	return servers;
});